#include <stdio.h>
#include "func.h"
#include "sort.h"

int find_halfbreak(int *a, int n)
{
    int i = 0;
    int num = 0;
    int head = 0;
    int tail = n;

    printf("input the number that you want :");
    scanf("%d",&num);

    do{
		i = (head + tail)/2;

		if(a[i] > num)
			tail = i;
		else if(a[i] <num)
			head = i;
		else
			break;
    }while(1);

    printf("i = %d\n",i);

    return 0;
}
